import request from '@/utils/request'

// 成本统计
export function CostStatistics(query) {
	return request({
		url: "/financial/count/cost",
		method: "POST",
		data: query
	})
}


// 收入统计
export function IncomeStatistics(query) {
	return request({
		url: "/financial/count/gross/profit",
		method: "POST",
		data: query
	})
}

export function profitStatistics(query) {
	return request({
		url: "/financial/count/gross/profit",
		method: "POST",
		data: query
	})
}

// 消费排行榜
export function ConsumerRankings(msg) {
	let query = new FormData();
	query.append('sort', msg.sort);
	query.append('pageNum', msg.pageNum);
	query.append('pageSize', msg.pageSize);
	if (msg.productName != undefined) {
		query.append('productName', msg.productName);
	}
	if (msg.productCategoryId != undefined) {
		query.append('productCategoryId', msg.productCategoryId);
	}
	if (msg.startTime != undefined) {
		query.append('startTime', msg.startTime);
		query.append('endTime', msg.endTime);
	}
	return request({
		headers: {
			"Content-Type": "multipart/form-data"
		},
		url: "/financial/count/gross/consumer/sort",
		method: "POST",
		data: query
	})
}


// 销售排行榜

export function SalesRanking(query) {
	return request({

		url: "/financial/sale/sort",
		method: "POST",
		data: query
	})
}

//配送盘点
export function deliveryStatistics(query) {
	return request({
		url: "/financial/delivery/data",
		method: "POST",
		data: query
	})
}
